home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
c4
/
pro2
/
1n06039b
< prev
next >
Wrap
Text File
|
1990-10-03
|
459b
|
39 lines
Listing 5
/*
* scan.c
*/
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include "scan.h"
int yylex(void)
{
int c;
while (isspace(c = getchar()) && c != '\n')
;
if (isdigit(c))
{
yylval = 0;
do
yylval = 10 * yylval + c - '0';
while (isdigit(c = getchar()));
ungetc(c, stdin);
return INT;
}
return c;
}
void yyrestart(void)
{
int c;
while ((c = getchar()) != '\n')
;
}